Skip to content

Comments

Fix: ntype after remapping#26

Merged
huangziwei merged 2 commits intomainfrom
fix_ntype
Nov 25, 2025
Merged

Fix: ntype after remapping#26
huangziwei merged 2 commits intomainfrom
fix_ntype

Conversation

@huangziwei
Copy link
Collaborator

Problem

  • Manual post pipelines (post.detect_soma/reroot after skeletonization) remapped ntype using the old permutation but always forced the new index 0 to 1 without clearing the old soma label. When the soma moved, the previous root kept ntype==1, producing two soma nodes intermittently. The full automatic pipeline didn’t hit this because ntype is None during its post steps.

Fix

  • After remapping ntype, explicitly clear any duplicate soma labels so only index 0 remains 1.
  • When rerooting with set_soma_ntype=True, also strip any extra ntype==1 outside the new root.
  • Added regression tests to ensure reroot and detect_soma leave exactly one soma label.

@huangziwei huangziwei merged commit 733dd3a into main Nov 25, 2025
5 checks passed
@huangziwei huangziwei deleted the fix_ntype branch January 27, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant